﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;

namespace IDT.Entity
{
    public class Album
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column(Order = 0)]
        public Guid AlbumKey { get; set; }

        [Column(Order = 1)]
        public Guid CategoryKey { get; set; }

        [Column(Order = 2)]
        public int CategoryId { get; set; }

        [Column(Order = 3)]
        public int AlbumId { get; set; }

        [Column(Order = 4)]
        public string Name { get; set; }

        [Column(Order = 6)]
        public string Url { get; set; }

        [Column(Order = 7)]
        public string AlbumCoverUrl { get; set; }

        [Column(Order = 8)]
        public DateTime? InsertedTime { get; set; }

        [Column(Order = 9)]
        public DateTime? UpdatedTime{ get; set; }

        [NotMapped]
        public Photo AlbumCover { get; set; }

        [XmlIgnore]
        public Category Category { get; set; }

        [NotMapped]
        public virtual List<Photo> Photos { get; set; } = new List<Photo>();

    }
}